package com.xayy.health.mgt.service;

import cn.kawins.base.result.CheckResult;
import com.xayy.health.mgt.model.CalculateModelTrain;
import com.xayy.health.mgt.model.TaskInfo;
import com.xayy.health.mgt.model.dto.TelemetryDto;
import com.xayy.health.mgt.model.vo.PredictDataVo;
import com.xayy.health.mgt.model.vo.ResultDataVo;

import java.net.UnknownHostException;

/**
 * @author zhangxa
 */
public interface CalculateService {

    /**
     * 模型训练
     *
     * @param modelTrain 入参信息
     * @param recordId   入参
     * @return 结果日志
     */
    CheckResult<Object> modelTrial(CalculateModelTrain modelTrain, Long recordId) throws UnknownHostException;

    /**
     * 启动模型
     * @param modelTrain 入参信息
     * @return 结果日志
     */
    CheckResult<?> startModel(CalculateModelTrain modelTrain);

    /**
     * 异步线程池执行任务
     * @param taskInfo 任务信息
     */
    void asyncExcuteTask(TaskInfo taskInfo) throws UnknownHostException;

    /**
     * 根据子任务id获取任务预测点集合
     * @param predictDataVo 任务id
     * @return 结果日志
     */
    CheckResult<Object> getTaskTrendDataList(PredictDataVo predictDataVo) throws UnknownHostException;

    /**
     * 查询结果数据
     * @param resultDataVo
     * @return 结果日志
     */
    CheckResult<Object> getResultDataList(ResultDataVo resultDataVo) throws UnknownHostException;


    /**
     * 趋势预测上线运行
     * @param telemetryDto 参数
     * @return CheckResult
     */
    CheckResult<Object> online(TelemetryDto telemetryDto);
}
